package com.darrenchan.course04

object SimpleObjectApp {
  def main(args: Array[String]): Unit = {
    val person = new Person()
    person.name = "Messi"
    println(person.name)
    println(person.age)

    println(person.eat)

    person.printInfo()
  }
}

class Person {
  var name: String = _
  val age: Int = 10
  private [this] var gender: String = "male"

  def printInfo(): Unit ={
    println("gender: " + gender)
  }

  def eat(): String ={
    name + " eat..."
  }

  def watchFootball(teamName: String): Unit = {
    println(name + " is watching match of " + teamName)
  }
}
